tools: update eslint to v10#61905
Conversation
|
Review requested:
|
| { moduleName: requiredModule }, | ||
| ); | ||
| context.report({ | ||
| node: node.body[0] ?? node, |
There was a problem hiding this comment.
The ESLint v10 has modified the ranges of a Program to cover the leading comments.
https://eslint.org/docs/latest/use/migrate-to-10.0.0#-program-ast-node-range-spans-entire-source-text
As a result, the /* eslint-disable */ comment does not work if we still report error at the start of the program, since the comment will be after the start of the Program node. Here we report at the first statement.
c.f. eslint/eslint#20451
| jsdoc.configs['flat/recommended'], | ||
| { | ||
| files: ['**/*.{js,cjs}'], | ||
| files: ['**/*.js'], |
There was a problem hiding this comment.
ESLint will automatically set sourceType of .cjs to commonjs, so we don't need specify the sourceType for cjs files.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61905 +/- ##
==========================================
- Coverage 89.65% 89.65% -0.01%
==========================================
Files 676 676
Lines 206326 206324 -2
Branches 39520 39522 +2
==========================================
- Hits 184990 184979 -11
- Misses 13471 13491 +20
+ Partials 7865 7854 -11
🚀 New features to boost your workflow:
|
sheplu
left a comment
There was a problem hiding this comment.
LGTM but do we want to wait for a stable release of babel?
I understand your concern, as a maintainer I am pretty confident about The remaining Babel 8 tasks towards a stable release are mostly typing improvements, as it is the first major Babel release with typing definitions. But we (the Node.js repo) don't use the typing part anyway so it is not very relevant. I can open a new PR once Babel 8 reaches a stable release. |
|
IMO, |
|
Yes, you are right. The policy of ESLint is to support every stage 4 features, so it supports all modern syntax out of the box. However, I believe we used Lines 103 to 108 in 488a854 which is used in our docs (eslint also lints example codes): Lines 749 to 764 in 488a854 We could switch |
|
Can you please rebase to fix the confict? |
Disable `reportGlobalThis`, essentially restore the behaviour to ESLint v9.
This option is enabled by default in Babel 8.
Commit Queue failed- Loading data for nodejs/node/pull/61905 ✔ Done loading data for nodejs/node/pull/61905 ----------------------------------- PR info ------------------------------------ Title tools: update eslint to v10 (#61905) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch JLHwung:update-eslint -> nodejs:main Labels lib / src, author ready, needs-ci Commits 9 - tools: bump eslint to v10, babel to v8.0.0-rc.2 - tools: update rules for ESLint 10 - tools: update eslint config - tools: no-unassigned-vars - tools: preserve-caught-error - tools: no-global-assign - tools: turn on no-shadow-restricted-names - tools: npm dedupe - tools: remove createImportExpressions from config Committers 1 - Huáng Jùnliàng <jlhwung@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61905 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61905 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 20 Feb 2026 18:39:24 GMT ✔ Approvals: 1 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/61905#pullrequestreview-3880933704 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-03-03T13:43:32Z: https://ci.nodejs.org/job/node-test-pull-request/71544/ - Querying data for job/node-test-pull-request/71544/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD 4eac93779a..3b9fe896c3 main -> origin/main ✔ origin/main is now up-to-date main is out of sync with origin/main. Mismatched commits: - 3b9fe896c3 2026-03-03, Version 25.8.0 (Current) -------------------------------------------------------------------------------- HEAD is now at 3b9fe896c3 2026-03-03, Version 25.8.0 (Current) ✔ Reset to origin/main - Downloading patch for 61905 From https://github.com/nodejs/node * branch refs/pull/61905/merge -> FETCH_HEAD ✔ Fetched commits as 4eac93779a99..100c22a248ea -------------------------------------------------------------------------------- [main 741b0507e2] tools: bump eslint to v10, babel to v8.0.0-rc.2 Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:29:31 2026 -0500 2 files changed, 356 insertions(+), 501 deletions(-) [main 6ef6cacc62] tools: update rules for ESLint 10 Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:31:02 2026 -0500 3 files changed, 13 insertions(+), 12 deletions(-) [main 83dfb77af6] tools: update eslint config Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:31:26 2026 -0500 1 file changed, 4 insertions(+), 3 deletions(-) [main 8e4bfada25] tools: no-unassigned-vars Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:32:05 2026 -0500 2 files changed, 2 insertions(+), 3 deletions(-) [main 6348276f94] tools: preserve-caught-error Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:32:36 2026 -0500 1 file changed, 5 insertions(+), 5 deletions(-) [main b7ae3a99ff] tools: no-global-assign Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:32:49 2026 -0500 2 files changed, 4 insertions(+) [main 7030d2f8f4] tools: turn on no-shadow-restricted-names Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 13:48:11 2026 -0500 1 file changed, 1 insertion(+), 1 deletion(-) [main 907f2b1ac3] tools: npm dedupe Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Fri Feb 20 15:06:17 2026 -0500 1 file changed, 5 insertions(+), 5 deletions(-) [main 635cffe9c5] tools: remove createImportExpressions from config Author: Huáng Jùnliàng <jlhwung@gmail.com> Date: Sun Feb 22 11:47:48 2026 -0500 1 file changed, 1 deletion(-) ✔ Patches applied There are 9 commits in the PR. Attempting autorebase. (node:350) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/18) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- tools: bump eslint to v10, babel to v8.0.0-rc.2https://github.com/nodejs/node/actions/runs/22631092293 |
|
Landed in e554661 |
In this PR we bumped
tools/eslintto v10 and the@babel/*to 8.0.0-rc.2, the first version shipped with ESLint v10 support.The eslint rules are revised due to breaking changes in ESLint v10. To limit the size of this PR, I have also turned off one new recommended rules in v10:
no-useless-assignment, as it introduced hundreds of errors across the codebase. We can investigate later if we want to enable this rule.